<template>
  <van-grid class="vg" :column-num="5" :border="false">
    <van-grid-item v-for="item of category" :key="item.mallCategoryId">
      <router-link :to="{path:'/list',query:{id:item.goodsId}}">
        <van-image :src="$filterImage(item.image)" lazy-load />
        <div class="name">{{item.mallCategoryName}}</div>
      </router-link>
    </van-grid-item>
  </van-grid>
</template>

<script>
export default {
  data() {
    return {
      category: []
    };
  },
  created() {
    this.$eventBus.$on("getIndexInfo", res => {
      //console.log(res);
      this.category = res.category;
    });
  }
};
</script>

<style>
.name {
  color: #000;
  text-align: center;
}
</style>